package util.list;

public class ListUtil {
    public static ListNode createList(Integer[] listNodes) {
        ListNode head = new ListNode(-1);// 根节点
        ListNode next = head;

        for (int val : listNodes) {
            next.next = new ListNode(val);
            next = next.next;
        }
        return head.next;
    }

    public static void main(String[] args) {
        ListNode list = ListUtil.createList(new Integer[]{0, 1, 2, 4, 5, 6, 7});
        System.out.println(list);
    }
}

